/*
 * Copyright Aduna (http://www.aduna-software.com/) (c) 2008.
 *
 * Licensed under the Aduna BSD-style license.
 */
package edu.tju.rdfbase.store;

import edu.tju.rdfbase.store.StoreException;

/**
 * An interface for an RDF Storage And Inference Layer. RDF Stores can store RDF
 * statements and evaluate queries over them. Statements can be stored in named
 * contexts or in the null context. Contexts can be used to group sets of
 * statements that logically belong together, for example because they come from
 * the same source. Both URIs and bnodes can be used as context identifiers.
 * 
 * @author James Leigh
 */
public interface NotifyingStore extends Store {

	/**
	 * Opens a connection on the Store which can be used to query and update data.
	 * Depending on how the implementation handles concurrent access, a call to
	 * this method might block when there is another open connection on this
	 * Store.
	 * 
	 * @throws StoreException
	 *         If no transaction could be started, for example because the Store
	 *         is not writable.
	 */
	public NotifyingStoreConnection getConnection()
		throws StoreException;

	/**
	 * Adds the specified StoreChangedListener to receive events when the data in
	 * this Store object changes.
	 */
	public void addStoreChangedListener(StoreChangedListener listener);

	/**
	 * Removes the specified StoreChangedListener so that it no longer receives
	 * events from this Store object.
	 */
	public void removeStoreChangedListener(StoreChangedListener listener);
}
